﻿using System;

namespace ChineseChessFen
{
    class Program
    {
        static void Main(string[] args)
        {
            char[,] board = new char[,]
            {
                { 'r','n','b','a','k','a','b','n','r' },
                { '0','0','0','0','0','0','0','0','0' },
                { '0','c','0','0','0','0','0','c','0' },
                { 'p','0','p','0','p','0','p','0','p' },
                { '0','0','0','0','0','0','0','0','0' },
                { '0','0','0','0','0','0','0','0','0' },
                { 'P','0','P','0','P','0','P','0','P' },
                { '0','C','0','0','0','0','0','C','0' },
                { '0','0','0','0','0','0','0','0','0' },
                { 'R','N','B','A','K','A','B','N','R' },
            };


            Console.WriteLine(FenUtil.BoardToFen(board));



            string fen = "2bak4/4a4/4b4/4C4/p6r1/3R5/c1p5P/1C2B4/4A4/3AK1B2";
            board = FenUtil.FenToBoard(fen);
            for(int i = 0; i < 10; i++)
            {
                for(int j = 0; j < 9; j++)
                {
                    Console.Write(board[i, j] + " ");
                }
                Console.WriteLine();
            }
        }
    }
}
